Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 3 - Image Compression Manager / Image Compression Manager Reference
Application-Defined Functions


Completion Functions

Compressor components call completion functions when they have finished an asynchronous operation. The component supplies a result code to your completion function. This result code indicates the success or failure of the asynchronous operation. Note that any other result data that may be produced by the asynchronous operation is not valid until the component calls your completion function.

The CompletionProcPtr data type defines a pointer to a completion function. You assign a completion function to an image or a sequence by passing a pointer to a structure that identifies the function to the appropriate function.

typedef struct CompletionProcRecord CompletionProcRecord;

The completion function structure contains the following fields:

typedef CompletionProcRecord *CompletionProcRecordPtr;
struct CompletionProcRecord 
{
   CompletionProcPtr completionProc;   
                              /* pointer to completion function */
   long              completionRefCon;          
                              /* reference constant */
};
Field Description
completionProc

Contains a pointer to your completion function. Your completion function may be called at interrupt time. Therefore, the value of the A5 register is unknown, and your function may not use Memory Manager functions or other functions that move memory.
completionRefCon
Contains a reference constant for use by your completion function.

Subtopics
MyCompletionProc

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996